import chilkat

rsaEncryptor = chilkat.CkRsa()

#  Encrypted output is always binary.  In this case, we want
#  to encode the encrypted bytes in a printable string.
#  Our choices are "hex", "base64", "url", "quoted-printable".
rsaEncryptor.put_EncodingMode("hex")

#  We'll encrypt with the public key and decrypt with the private
#  key.  It's also possible to do the reverse.
rsaEncryptor.ImportPrivateKey(open('aaa010101aaa_csd_08.key.pem').read())

usePrivateKey = True
encryptedStr = rsaEncryptor.EncryptString(open('cadenaOriginal.txt').read(), usePrivateKey)


print encryptedStr
